$(".left-nav")
$(".nav-item").hover(function() {
    $(this).css("background", "#D52C27")
}, function() {
    $(this).css("background", "rgba(0, 0, 0, .6)")
})
$(".nav-maodian-item").hover(function() {
    $(this).css("background", "#D52C27")
}, function() {
    $(this).css("background", "rgba(0, 0, 0, .6)")
})

$(".maodian").children(".nav-maodian-item").click(function() {
    $("html").stop().animate({
        scrollTop: ($(".floor-item").eq($(this).index()).offset().top)
    })
})
$(".nav-item").click(function() {
    $("html").stop().animate({
        scrollTop: 0
    })
})
$(window).scroll(function() {
    if ($("html").scrollTop() > $(".h2_title").eq(0).offset().top) {
        $(".left-nav").css("display", "flex")
    } else {
        $(".left-nav").css("display", "none")
    }
})






let leftDistance = 0;
let totalDistance = 3000;
const carousel_inner = document.querySelector(".carousel-inner")
const carousel = document.querySelector(".carousel")
let time = null;
let test = function () {
    if (leftDistance < totalDistance) {
        leftDistance += 1000;
    } else {
        leftDistance = 0;
    }
    carousel_inner.style.transform = `translate(-${leftDistance}px)`
}
time = setInterval(test, 3000);